﻿#pragma once

#include "../../MirControls/MirImageControl.h"
#include "../../MirControls/MirLabel.h"
#include "../../MirControls/MirButton.h"
#include <string>

using namespace Client::MirControls;
using namespace Client::MirGraphics;
using namespace Client::MirNetwork;
using namespace Client::MirSounds;
namespace C = ClientPackets;

namespace Client::MirScenes::Dialogs
{
    class ItemRentDialog final : public MirImageControl
    {
    private:
        MirLabel *const _nameLabel, *const _rentalPriceLabel;
        MirButton *const _lockButton, *const _rentalPriceButton;

    public:
        virtual ~ItemRentDialog()
        {
            delete _nameLabel;
            delete _rentalPriceLabel;
            delete _lockButton;
            delete _rentalPriceButton;
        }

        ItemRentDialog();

        void RefreshInterface();

        void OpenItemRentDialog();

        void Reset();

        void Lock();

    private:
        void Unlock();

        static void CancelItemRental();
    };

    class GuestItemRentDialog final : public MirImageControl
    {
    public:
        virtual ~GuestItemRentDialog()
        {
            delete _nameLabel;
            delete _rentalPriceLabel;
            delete _lockButton;
            delete _rentalPriceButton;
        }

        std::string getGuestName() const;

    private:
        MirLabel *const _nameLabel, *const _rentalPriceLabel;
        MirButton *const _lockButton, *const _rentalPriceButton;
        std::string _guestName;
        unsigned int _guestGold = 0;
        bool _guestGoldLocked = false;

    public:
        GuestItemRentDialog();

        void RefreshInterface();

        void SetGuestName(const std::string &name);

        void SetGuestFee(unsigned int amount);

        void Reset();

        void Lock();

    private:
        void Unlock();
    };
}
